
* Institutional Innovation in Response to Backlash:
* How Members Are Circumventing the WTO Impasse

* Replication *

* Set directory to "MPIA Replication" folder
* cd "C:\path\to\your\directory"
pwd 

* Question 1: Who joins the MPIA?


use "MPIA_replication_Q1.dta"

* Table: Drivers of MPIA Membership 
 
eststo clear

eststo:	probit mpia_i log_off_i_mpia_2019  log_vuln_i_mpia_2019, cluster(i)

eststo:	probit mpia_i log_off_i_nonmpia_2019  log_vuln_i_nonmpia_2019, cluster(i)

eststo:	probit mpia_i log_off_i_mpia_2019  log_vuln_i_mpia_2019 rule_of_law  log_gdp log_gdp_per_capita complainant_N respondent_N abs_dist_to_US  , cluster(i)

eststo:	probit mpia_i log_off_i_nonmpia_2019  log_vuln_i_nonmpia_2019 rule_of_law  log_gdp log_gdp_per_capita complainant_N respondent_N abs_dist_to_US  , cluster(i)

eststo:	probit mpia_i log_off_i_mpia_2019  log_vuln_i_mpia_2019 rule_of_law  log_gdp log_gdp_per_capita complainant_N respondent_N abs_dist_to_US  total_ptas_ds_prov, cluster(i)

eststo:	probit mpia_i log_off_i_nonmpia_2019  log_vuln_i_nonmpia_2019 rule_of_law  log_gdp log_gdp_per_capita complainant_N respondent_N abs_dist_to_US  total_ptas_ds_prov, cluster(i)

esttab using "Table1_updated.tex", label keep( log_off_i_mpia_2019  log_vuln_i_mpia_2019 log_off_i_nonmpia_2019  log_vuln_i_nonmpia_2019 rule_of_law log_gdp log_gdp_per_capita complainant_N respondent_N abs_dist_to_US total_ptas_ds_prov) order() nonotes se(3) b(3) replace star(* 0.10 ** 0.05 *** 0.01) compress nogaps nodepvars 
		

* Appendix Table 1

eststo clear

eststo:	relogit mpia_i log_off_i_mpia_2019  log_vuln_i_mpia_2019, cluster(i)

eststo:	relogit mpia_i log_off_i_nonmpia_2019  log_vuln_i_nonmpia_2019, cluster(i)

eststo:	relogit mpia_i log_off_i_mpia_2019  log_vuln_i_mpia_2019  rule_of_law log_gdp log_gdp_per_capita complainant_N respondent_N abs_dist_to_US, cluster(i)

eststo:	relogit mpia_i log_off_i_nonmpia_2019  log_vuln_i_nonmpia_2019 rule_of_law log_gdp log_gdp_per_capita complainant_N respondent_N abs_dist_to_US, cluster(i)
	
esttab using "Table_relogit_updated.tex", label keep( log_off_i_mpia_2019  log_vuln_i_mpia_2019 log_off_i_nonmpia_2019  log_vuln_i_nonmpia_2019 rule_of_law log_gdp log_gdp_per_capita complainant_N respondent_N abs_dist_to_US ) order() nonotes se(3) b(3) replace star(* 0.10 ** 0.05 *** 0.01) compress nogaps nodepvars 


* Appendix Table 2

eststo clear

eststo: probit mpia_i log_off_i_mpia_2019  rule_of_law log_gdp log_gdp_per_capita complainant_N respondent_N abs_dist_to_US  total_ptas_ds_prov, cluster(i)
		
eststo: probit mpia_i log_vuln_i_mpia_2019 rule_of_law  log_gdp log_gdp_per_capita complainant_N respondent_N abs_dist_to_US  total_ptas_ds_prov, cluster(i)

eststo: probit mpia_i log_off_i_nonmpia_2019  rule_of_law log_gdp log_gdp_per_capita complainant_N respondent_N abs_dist_to_US  total_ptas_ds_prov, cluster(i)

eststo: probit mpia_i log_vuln_i_nonmpia_2019  rule_of_law log_gdp log_gdp_per_capita complainant_N respondent_N abs_dist_to_US  total_ptas_ds_prov, cluster(i)
		
esttab using "Table_separate.tex", label keep( log_off_i_mpia_2019  log_vuln_i_mpia_2019 log_off_i_nonmpia_2019 rule_of_law log_vuln_i_nonmpia_2019  log_gdp log_gdp_per_capita complainant_N respondent_N abs_dist_to_US total_ptas_ds_prov) order() nonotes se(3) b(3) replace star(* 0.10 ** 0.05 *** 0.01) compress nogaps nodepvars 
		

* Question 2: Who joins the MPIA?
		
use  "MPIA_replication_Q2.dta", clear 		

eststo clear

eststo: areg harmful mpia_dyad log_i_gdp log_j_gdp log_i_gdp_per_capita log_j_gdp_per_capita i_rule_of_law j_rule_of_law complainant_N respondent_N compl_resp_N mean_netwin_compl_resp logexportin1000usd logimportin1000usd, abs(year) cluster(dyad_id)

eststo: areg liberalizing mpia_dyad log_i_gdp log_j_gdp log_i_gdp_per_capita log_j_gdp_per_capita i_rule_of_law j_rule_of_law complainant_N respondent_N compl_resp_N mean_netwin_compl_resp logexportin1000usd logimportin1000usd, abs(year) cluster(dyad_id)

eststo: mi estimate, post: areg harmful mpia_dyad log_i_gdp log_j_gdp log_i_gdp_per_capita log_j_gdp_per_capita i_rule_of_law j_rule_of_law complainant_N respondent_N compl_resp_N mean_netwin_compl_resp logexportin1000usd logimportin1000usd, abs(year) cluster(dyad_id)

eststo: mi estimate, post: areg liberalizing mpia_dyad log_i_gdp log_j_gdp log_i_gdp_per_capita log_j_gdp_per_capita i_rule_of_law j_rule_of_law complainant_N respondent_N compl_resp_N mean_netwin_compl_resp logexportin1000usd logimportin1000usd, abs(year) cluster(dyad_id)
		
eststo: areg harmful mpia_dyad log_i_gdp log_j_gdp log_i_gdp_per_capita log_j_gdp_per_capita i_rule_of_law j_rule_of_law complainant_N respondent_N compl_resp_N mean_netwin_compl_resp logexportin1000usd logimportin1000usd pta_num, abs(year) cluster(dyad_id)

eststo: areg liberalizing mpia_dyad log_i_gdp log_j_gdp log_i_gdp_per_capita log_j_gdp_per_capita i_rule_of_law j_rule_of_law complainant_N respondent_N compl_resp_N mean_netwin_compl_resp logexportin1000usd logimportin1000usd pta_num, abs(year) cluster(dyad_id)
	
esttab using "Table_effects.tex", label keep(mpia_dyad log_i_gdp log_j_gdp log_i_gdp_per_capita log_j_gdp_per_capita i_rule_of_law j_rule_of_law complainant_N respondent_N compl_resp_N mean_netwin_compl_resp logexportin1000usd logimportin1000usd pta_num) order() nonotes se(3) b(3) replace star(* 0.10 ** 0.05 *** 0.01) compress nogaps nodepvars 


* To generate Figure: MPIA Membership Effects Through Time

* start with harmful measures

* baseline with controls
areg harmful mpia_dyad log_i_gdp log_j_gdp log_i_gdp_per_capita log_j_gdp_per_capita i_rule_of_law j_rule_of_law complainant_N respondent_N compl_resp_N mean_netwin_compl_resp, abs(year) cluster(dyad_id)	
 
* baseline for changing years:

* names the variable with different labels for graphing convenience: 
gen mpia_dyad_2020=mpia_dyad
gen mpia_dyad_2021=mpia_dyad
gen mpia_dyad_2022=mpia_dyad

eststo clear

 areg harmful mpia_dyad_2020 log_i_gdp log_j_gdp log_i_gdp_per_capita log_j_gdp_per_capita i_rule_of_law j_rule_of_law complainant_N respondent_N compl_resp_N mean_netwin_compl_resp  if year!=2021 & year!=2022, abs(year) cluster(dyad_id)
estimates store model2020h

 areg harmful mpia_dyad_2021 log_i_gdp log_j_gdp log_i_gdp_per_capita log_j_gdp_per_capita i_rule_of_law j_rule_of_law complainant_N respondent_N compl_resp_N mean_netwin_compl_resp if year!=2020 & year!=2022, abs(year) cluster(dyad_id)
estimates store model2021h

 areg harmful mpia_dyad_2022 log_i_gdp log_j_gdp log_i_gdp_per_capita log_j_gdp_per_capita i_rule_of_law j_rule_of_law complainant_N respondent_N compl_resp_N mean_netwin_compl_resp  if year!=2020 & year!=2021, abs(year) cluster(dyad_id)
estimates store model2022h
 
coefplot model2022h model2021h model2020h, keep(mpia_dyad_2020 mpia_dyad_2021  mpia_dyad_2022 ) ///
xline(0) ///
ytitle("mpia_dyad Coefficient") ///
xtitle("Years")  
  * make pretty
 
  graph save Graph "harmful_coeffplot.gph", replace
  
* same for liberalizing: 
 
*  baseline with controls
 areg liberalizing mpia_dyad log_i_gdp log_j_gdp log_i_gdp_per_capita log_j_gdp_per_capita i_rule_of_law j_rule_of_law complainant_N respondent_N compl_resp_N mean_netwin_compl_resp, abs(year) cluster(dyad_id)	
	
* baseline for changing years:

eststo clear

 areg  liberalizing mpia_dyad_2020 log_i_gdp log_j_gdp log_i_gdp_per_capita log_j_gdp_per_capita i_rule_of_law j_rule_of_law complainant_N respondent_N compl_resp_N mean_netwin_compl_resp  if year!=2021 & year!=2022, abs(year) cluster(dyad_id)
estimates store model2020l

 areg  liberalizing mpia_dyad_2021 log_i_gdp log_j_gdp log_i_gdp_per_capita log_j_gdp_per_capita i_rule_of_law j_rule_of_law complainant_N respondent_N compl_resp_N mean_netwin_compl_resp if year!=2020 & year!=2022, abs(year) cluster(dyad_id)
estimates store model2021l

 areg  liberalizing mpia_dyad_2022 log_i_gdp log_j_gdp log_i_gdp_per_capita log_j_gdp_per_capita i_rule_of_law j_rule_of_law complainant_N respondent_N compl_resp_N mean_netwin_compl_resp  if year!=2020 & year!=2021, abs(year) cluster(dyad_id)
estimates store model2022l
 
 
coefplot model2022l model2021l model2020l, keep(mpia_dyad_2020 mpia_dyad_2021  mpia_dyad_2022 ) ///
xline(0) ///
ytitle("mpia_dyad Coefficient") ///
xtitle("Years") 
  * make pretty
  
  graph save Graph "liberal_coeffplot.gph", replace
  
 graph combine "harmful_coeffplot.gph"  "liberal_coeffplot.gph", ycommon
  * make pretty
  
** end **
